﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;

using H2.NET.Controls;
using H2.NET.Business;
using H2.NET.Data.Common;

namespace H2.NET.Web.Pages
{
    public partial class PTShip : TaskPage
    {
        #region 属性 Public
        private bool IsLoaded
        {
            get
            {
                return ViewState["IsLoaded"] == null ? false : (bool)ViewState["IsLoaded"];
            }
            set { ViewState["IsLoaded"] = value; }
        }
        #endregion

        #region 事件 Page_Load(页面加载)
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                INFO.Text = string.Format("<br/>表单正在被同事“{0}”抢占处理，拒绝提交！", RobUser);
                INFO.Visible = IsOverFlow;

                bool flg = (TaskAPI.IsBeginStep && TaskAPI.IsAllowSubmit) ? true : false;
                //InitDropDownList();

                #region 发起步骤
                if (TaskAPI.IsInitiate)
                {
                    //VD.Checked = true;
                }
                if ((TaskAPI.IsBeginStep && TaskAPI.IsAllowSubmit))
                {
                    InitDropDownList();
                    SetColor();
                }
                SetDefaultValue();
                #endregion

                #region 审批环节
                if (!TaskAPI.IsInitiate)
                {
                    #region 加载数据并显示
                    TW_cmd_Customer_Ship cmd = (TW_cmd_Customer_Ship.process == TaskAPI.Process & TW_cmd_Customer_Ship.incident == TaskAPI.Incident).ListFirst<TW_cmd_Customer_Ship>();
                    if (cmd != null)
                    {
                       
                        ApplicationNo.Text = cmd.ApplicationNo;
                        Actions.SelectedValue = cmd.Actions;
                        DrpPriority.SelectedValue = cmd.DrpPriority;
                        DMO_DrpPriority.SelectedValue = cmd.DMO_DrpPriority;
                        SetColor();


                        #region Ship to
                        ST_Sold_To_No.Text = cmd.ST_Sold_To_No;
                        ST_Old_Ship_BPCS.Text = cmd.ST_Old_Ship_BPCS;
                        ST_Sold_To_Name.Text = cmd.ST_Sold_To_Name;
                        ST_Search_Term1.Text = cmd.ST_Search_Term1;
                        ST_Search_Term2.Text = cmd.ST_Search_Term2;
                        ST_Ship_To_No.Text = cmd.ST_Ship_To_No;
                        ST_Ship_To_Name.Text = cmd.ST_Ship_To_Name;
                        ST_Country.Text = cmd.ST_Country;
                        ST_City.Text = cmd.ST_City;
                        ST_Street4.Text = cmd.ST_Street4;
                        ST_Address.Text = cmd.ST_Address;
                        ST_Contact_Person.Text = cmd.ST_Contact_Person;
                        ST_Tel.Text = cmd.ST_Tel;
                        ST_Postal_Code.Text = cmd.ST_Postal_Code;
                        ST_Mail.Text = cmd.ST_Mail;
                        ST_Fax.Text = cmd.ST_Fax;
                        ST_Transportation_Zone.Text = cmd.ST_Transportation_Zone;
                        ST_County_Code.Text = cmd.ST_County_Code;
                        ST_Sales_Org.Text = cmd.ST_Sales_Org;
                        ST_Currency.Text = cmd.ST_Currency;
                        ST_Delivering_Plant.Text = cmd.ST_Delivering_Plant;
                        ST_Tax_Classification.Text = cmd.ST_Tax_Classification;
                        ST_Itcoterms2.Text = cmd.ST_Itcoterms2;
                        ST_Cus_Grp3.Text = cmd.ST_Cus_Grp3;
                        ST_Partial_Delivery_Per_Item.Text = cmd.ST_Partial_Delivery_Per_Item;
                        ST_Max_Partial_Deliveries.Text = cmd.ST_Max_Partial_Deliveries;
                        ST_Depart_Country.Text = cmd.ST_Depart_Country;
                        ST_Attributes9.Text = cmd.ST_Attributes9;
                        ST_Distribution.Text = cmd.ST_Distribution;
                        ST_Cust_Pric.Text = cmd.ST_Cust_Pric;

                        SetDropDownListValue(ST_Default_Ship, cmd.ST_Default_Ship);
                        SetDropDownListValue(ST_DEL_ST_Address, cmd.ST_DEL_ST_Address);
                        SetDropDownListValue(ST_Region, cmd.ST_Region);
                        SetDropDownListValue(ST_Language, cmd.ST_Language);
                        SetDropDownListValue(ST_Industry, cmd.ST_Industry);
                        SetDropDownListValue(ST_Industry_Code1, cmd.ST_Industry_Code1);
                        SetDropDownListValue(ST_City_Code, cmd.ST_City_Code);
                        SetDropDownListValue(ST_Sales_Office, cmd.ST_Sales_Office);
                        SetDropDownListValue(ST_Sales_District, cmd.ST_Sales_District);
                        SetDropDownListValue(ST_Delivery_Priority, cmd.ST_Delivery_Priority);
                        SetDropDownListValue(ST_Shipping_Condition, cmd.ST_Shipping_Condition);
                        SetDropDownListValue(ST_Acct_Assgmt_Group, cmd.ST_Acct_Assgmt_Group);
                        SetDropDownListValue(ST_Itcoterms, cmd.ST_Itcoterms);
                        SetDropDownListValue(ST_Attributes1, cmd.ST_Attributes1);
                        SetDropDownListValue(ST_Attributes2, cmd.ST_Attributes2);
                        SetDropDownListValue(ST_Attributes3, cmd.ST_Attributes3);
                        SetDropDownListValue(ST_Attributes4, cmd.ST_Attributes4);
                        SetDropDownListValue(ST_Price_Group_1, cmd.ST_Price_Group_1);
                        SetDropDownListValue(ST_Price_Group_2, cmd.ST_Price_Group_2);


                        ST_Customer_Division_K1.Checked = cmd.ST_Customer_Division_K1 == "1";
                        ST_Customer_Division_K2.Checked = cmd.ST_Customer_Division_K2 == "1";
                        ST_Customer_Division_K3.Checked = cmd.ST_Customer_Division_K3 == "1";
                        ST_Customer_Division_K6.Checked = cmd.ST_Customer_Division_K6 == "1";
                        ST_Customer_Division_10.Checked = cmd.ST_Customer_Division_10 == "1";
                        ST_Customer_Division_K7.Checked = cmd.ST_Customer_Division_K7 == "1";
                        ST_Customer_Division_K4.Checked = cmd.ST_Customer_Division_K4 == "1";
                        ST_Customer_Division_K5.Checked = cmd.ST_Customer_Division_K5 == "1";
                        ST_Switch_Off_Rounding.Checked = cmd.ST_Switch_Off_Rounding == "1";
                        ST_Relevant_For_POD.Checked = cmd.ST_Relevant_For_POD == "1";
                        ST_Rebate.Checked = cmd.ST_Rebate == "1";
                        ST_Price_Determin.Checked = cmd.ST_Price_Determin == "1";
                        ST_Order_Combination.Checked = cmd.ST_Order_Combination == "1";
                        ST_Complete_Delivery_Reqd_By_Law.Checked = cmd.ST_Complete_Delivery_Reqd_By_Law == "1";
                        #endregion



                    }
                    #endregion

                    #region 审批项初始化
                    switch (TaskAPI.Step)
                    {
                        case "Manager Approve":
                        case "Accounting Manager":
                        case "Finance Manager":
                            Assessment1.Option.Add(new t_AssessmentOption("Approve", "1", true));
                            Assessment1.Option.Add(new t_AssessmentOption("Return", "2", false));
                            break;
                        case "DMO Approve":
                        case "DMO Maintain":
                        case "DMO Check":
                            Assessment1.Option.Add(new t_AssessmentOption("Finish", "1", true));
                            Assessment1.Option.Add(new t_AssessmentOption("Return", "2", false));
                            break;

                    }
                    #endregion
                    
                }
                #endregion



                #region 设置控件禁启用
                //bool flg = (TaskAPI.IsBeginStep && TaskAPI.IsAllowSubmit) ? true : false;

                SetEnable(flg, Actions,DrpPriority, ST_Customer_Division_K1, ST_Customer_Division_K2, ST_Customer_Division_K3,ST_Customer_Division_K4,ST_Customer_Division_K5, ST_Customer_Division_K6,ST_Customer_Division_10,ST_Customer_Division_K7, ST_Currency, ST_Transportation_Zone, ST_Itcoterms2, ST_Sold_To_No, ST_Old_Ship_BPCS, ST_Sold_To_Name, ST_Ship_To_No, ST_Ship_To_Name, ST_City, ST_Street4, ST_Address, ST_Contact_Person, ST_Tel, ST_Postal_Code, ST_Mail, ST_Fax, ST_Price_Group_1, ST_Price_Group_2, ST_Default_Ship, ST_DEL_ST_Address, ST_Region, ST_Language, ST_Industry, ST_Industry_Code1, ST_City_Code, ST_Sales_District, ST_Sales_Office,  ST_Delivery_Priority, ST_Shipping_Condition, ST_Acct_Assgmt_Group, ST_Itcoterms, ST_Attributes1, ST_Attributes2, ST_Attributes3, ST_Attributes4);
                SetEnable(TaskAPI.Step == "DMO Maintain", SAP_Code);
                SetEnable(TaskAPI.Step == "DMO Approve" | TaskAPI.Step == "DMO Maintain" | TaskAPI.Step == "DMO Check", DMO_DrpPriority);
                SetVisible(TaskAPI.Step == "DMO Approve" | TaskAPI.Step == "DMO Maintain" | TaskAPI.Step == "DMO Check", P_DMO);
                Assessment1.Enable = TaskAPI.IsAllowSubmit;
                SetVisible(TaskAPI.IsAllowSubmit, Send, Split);

                SetVisible(Actions.SelectedValue != "1");
                Attachment1.AllowDelete = TaskAPI.IsBeginStep && TaskAPI.IsAllowSubmit;
                Attachment1.AllowUpload = TaskAPI.IsBeginStep && TaskAPI.IsAllowSubmit;
                //InitTabs();
                #endregion

                #region 加深颜色
                string item = null;
                string value = null;
                foreach (Control cr in this.Controls)
                {
                    if (cr is DropDownList)
                    {
                        DropDownList tb = (DropDownList)cr;
                        if (!tb.Enabled)
                        {
                            tb.Enabled = true;
                            item = tb.SelectedItem.Text;
                            value = tb.SelectedValue.ToString();
                            tb.Items.Clear();
                            tb.Items.Add(new ListItem(item, value));
                        }
                        tb.ForeColor = System.Drawing.Color.DimGray;
                    }
                }
                if (!flg || !TaskAPI.IsAllowSubmit)
                {



                    foreach (Control cr in P_SA.Controls)
                    {
                        if (cr is DropDownList)
                        {
                            DropDownList tb = (DropDownList)cr;
                            if (!tb.Enabled)
                            {
                                tb.Enabled = true;
                                tb.ForeColor = System.Drawing.Color.DimGray;
                            }
                        }
                    }

                    foreach (Control cr in P_SA.Controls)
                    {
                        if (cr is TextBox)
                        {
                            TextBox tb = (TextBox)cr;
                            if (!tb.Enabled)
                            {
                                tb.Enabled = true;
                                tb.ReadOnly = true;
                                tb.ForeColor = System.Drawing.Color.DimGray;
                            }
                        }
                    }

                }

                #endregion
            }
        }
        #endregion

        #region 事件 Send
        protected void Send_Click(object sender, EventArgs e)
        {
            try
            {
                #region 数据验证
                if (TaskAPI.IsBeginStep && TaskAPI.IsAllowSubmit) // 如果是退回的情况，不存在验证
                {
                    List<string> vald_s = new List<string>();
                    vald_s.AddRange(DataValidation());
                    if (vald_s.Count > 0)
                    {
                        Anthem.Manager.AddScriptForClientSideEval(string.Format("ShowMessage(\"{0}\", {1});", CombineMessage(vald_s), vald_s.Count));
                        return;
                    }
                }
                #endregion

                #region 引擎传值
                if (TaskAPI.IsBeginStep)
                {
                    if (TaskAPI.IsInitiate)
                    {
                        ApplicationNo.Text = Util.GenerateSequence(((object[])TaskAPI["PrefixNo"])[0].ToString() + "-" + System.DateTime.Now.ToString("yyMM"), "", 4);
                        TaskAPI.UserName = UserAPI.UserName;
                        TaskAPI["ApplicationNo"] = ApplicationNo.Text;
                        TaskAPI["ApplicatorName"] = UserAPI.UserFullName;
                        TaskAPI["Applicator"] = UserAPI.UserName;
                        TaskAPI["Time"] = System.DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss");
                        TaskAPI["ApplicatorEmail"] = UserAPI.Mail;
                        TaskAPI["Department"] = UserAPI.Department;
                        TaskAPI["ServerName"] = Util.AppSettings("ServerName");
                    }

                    TaskAPI.Summary = (Actions.SelectedItem.Text.Split(',').Length >= 2 ? Actions.SelectedItem.Text.Split(',')[1].Trim() : Actions.Text) + ApplicationNo.Text;


                    //TaskAPI["finance_Type"] = VD.Checked && VD_finance_Type.SelectedValue == "内部(Internal)" ? "Internal" : "";
                    TaskAPI["Actions"] = Actions.SelectedValue;
                    TaskAPI["Remark_by_Initiator"] = Assessment1.Assessment.Remark;
                    TaskAPI["DrpPriority"] = DrpPriority.SelectedItem.Text;

                    #region 从数据库取得流程步骤处理人
                    SortedList<string, string> rec_a = new SortedList<string, string>();

                    IList<mdc_Recipient> rec_s = (mdc_Recipient.process == TaskAPI.Process & (mdc_Recipient.distribute == Actions.SelectedValue | mdc_Recipient.distribute == "*") & mdc_Recipient.status == 1).List<mdc_Recipient>();
                    foreach (mdc_Recipient rec in rec_s)
                    {
                        if (!rec_a.ContainsKey(rec.Step))
                        {
                            rec_a.Add(rec.Step, rec.Recipient);
                            continue;
                        }

                        if (rec_a.Values[rec_a.IndexOfKey(rec.Step)].Contains(rec.Recipient))
                        {
                            continue;
                        }

                        rec_a[rec.Step] = rec_a.Values[rec_a.IndexOfKey(rec.Step)] + "," + rec.Recipient;
                    }

                    //步骤处理人赋值
                    for (int i = 0; i < rec_a.Keys.Count; i++)
                    {
                        TaskAPI["R_" + rec_a.Keys[i].Replace(" ", "_")] = rec_a.Values[i].Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                    }

                    //m_OrgChart oc = (m_OrgChart.empID.In(m_OrgChart.dr2EmpID, m_OrgChart.winID == UserAPI.UserName)).ListFirst<m_OrgChart>();
                    //if(oc != null)
                    //{
                    //    TaskAPI["R_Manager_Approve2"] = oc.WinID;
                    //}

                    #endregion
                }
                else
                {
                    TaskAPI["ApproveResult"] = Assessment1.Assessment.Opinion;
                    TaskAPI["TaskID"] = TaskAPI.TaskID;
                }



                //#region 退回步骤并返回功能 传值
                //if (!string.IsNullOrEmpty(Assessment1.JumpStep))
                //{
                //    TaskAPI["Step"] = Assessment1.JumpStep;
                //    TaskAPI["PreStep"] = TaskAPI.Step;
                //}
                //else
                //{
                //    string PreStep = ((object[])TaskAPI["PreStep"])[0].ToString();
                //    if (PreStep.Trim() != "")
                //    {
                //        TaskAPI["Step"]    = PreStep;
                //        TaskAPI["PreStep"] = "";
                //    }
                //    else
                //    {
                //        TaskAPI["Step"] = "";
                //        TaskAPI["PreStep"] = "";
                //    }
                //}
                //#endregion

                #endregion

                #region 提交步骤
                bool flg = false;
                Storage.TransactionExecute(o =>
                {
                    #region “Fill in the form”步骤
                    if (TaskAPI.IsBeginStep)
                    {
                        TW_cmd_Customer_Ship cmd = new TW_cmd_Customer_Ship();
                        if ((TW_cmd_Customer_Ship.process == TaskAPI.Process & TW_cmd_Customer_Ship.incident == TaskAPI.Incident & TW_cmd_Customer_Ship.userName == UserAPI.UserName).Count<TW_cmd_Customer_Ship>() > 0)
                        {
                            cmd = (TW_cmd_Customer_Ship.process == TaskAPI.Process & TW_cmd_Customer_Ship.incident == TaskAPI.Incident & TW_cmd_Customer_Ship.userName == UserAPI.UserName).ListFirst<TW_cmd_Customer_Ship>();
                        }
                        else
                        {
                            cmd.Process = TaskAPI.Process;
                            cmd.Incident = TaskAPI.Incident;
                            cmd.UserName = UserAPI.UserName;
                            cmd.UserFullName = UserAPI.UserFullName;
                            cmd.ApplicationNo = ApplicationNo.Text;
                            cmd.Time = System.DateTime.Now;
                            cmd.Status = 0;
                            cmd.Department = UserAPI.Department;
                        }

                        cmd.Actions = Actions.SelectedValue;
                        cmd.DrpPriority = DrpPriority.SelectedValue;



                        #region SA
                        //if (SA.Checked)
                        //{
                        cmd.ST_Sold_To_No = ST_Sold_To_No.Text;
                        cmd.ST_Old_Ship_BPCS = ST_Old_Ship_BPCS.Text;
                        cmd.ST_Sold_To_Name = ST_Sold_To_Name.Text;
                        cmd.ST_Search_Term1 = ST_Search_Term1.Text;
                        cmd.ST_Search_Term2 = ST_Search_Term2.Text;
                        cmd.ST_Ship_To_No = ST_Ship_To_No.Text;
                        cmd.ST_Ship_To_Name = ST_Ship_To_Name.Text;
                        cmd.ST_Country = ST_Country.Text;
                        cmd.ST_City = ST_City.Text;
                        cmd.ST_Street4 = ST_Street4.Text;
                        cmd.ST_Address = ST_Address.Text;
                        cmd.ST_Contact_Person = ST_Contact_Person.Text;
                        cmd.ST_Tel = ST_Tel.Text;
                        cmd.ST_Postal_Code = ST_Postal_Code.Text;
                        cmd.ST_Mail = ST_Mail.Text;
                        cmd.ST_Fax = ST_Fax.Text;
                        cmd.ST_Transportation_Zone = ST_Transportation_Zone.Text;
                        cmd.ST_County_Code = ST_County_Code.Text;
                        cmd.ST_Sales_Org = ST_Sales_Org.Text;
                        cmd.ST_Currency = ST_Currency.Text;
                        cmd.ST_Delivering_Plant = ST_Delivering_Plant.Text;
                        cmd.ST_Tax_Classification = ST_Tax_Classification.Text;
                        cmd.ST_Itcoterms2 = ST_Itcoterms2.Text;
                        cmd.ST_Cus_Grp3 = ST_Cus_Grp3.Text;
                        cmd.ST_Partial_Delivery_Per_Item = ST_Partial_Delivery_Per_Item.Text;
                        cmd.ST_Max_Partial_Deliveries = ST_Max_Partial_Deliveries.Text;
                        cmd.ST_Depart_Country = ST_Depart_Country.Text;
                        cmd.ST_Attributes9 = ST_Attributes9.Text;
                        cmd.ST_Distribution = ST_Distribution.Text;
                        cmd.ST_Cust_Pric = ST_Cust_Pric.Text;
                        

                        cmd.ST_Default_Ship = ST_Default_Ship.SelectedValue;
                        cmd.ST_DEL_ST_Address = ST_DEL_ST_Address.SelectedValue;
                        cmd.ST_Region = ST_Region.SelectedValue;
                        cmd.ST_Language = ST_Language.SelectedValue;
                        cmd.ST_Industry = ST_Industry.SelectedValue;
                        cmd.ST_Industry_Code1 = ST_Industry_Code1.SelectedValue;
                        cmd.ST_City_Code = ST_City_Code.SelectedValue;
                        cmd.ST_Sales_Office = ST_Sales_Office.SelectedValue;
                        cmd.ST_Sales_District = ST_Sales_District.SelectedValue;
                        cmd.ST_Delivery_Priority = ST_Delivery_Priority.SelectedValue;
                        cmd.ST_Shipping_Condition = ST_Shipping_Condition.SelectedValue;
                        cmd.ST_Acct_Assgmt_Group = ST_Acct_Assgmt_Group.SelectedValue;
                        cmd.ST_Itcoterms = ST_Itcoterms.SelectedValue;
                        cmd.ST_Attributes1 = ST_Attributes1.SelectedValue;
                        cmd.ST_Attributes2 = ST_Attributes2.SelectedValue;
                        cmd.ST_Attributes3 = ST_Attributes3.SelectedValue;
                        cmd.ST_Attributes4 = ST_Attributes4.SelectedValue;
                        cmd.ST_Price_Group_1 = ST_Price_Group_1.SelectedValue;
                        cmd.ST_Price_Group_2 = ST_Price_Group_2.SelectedValue;


                        cmd.ST_Customer_Division_K1 = ST_Customer_Division_K1.Checked ? "1" : "0";
                        cmd.ST_Customer_Division_K2 = ST_Customer_Division_K2.Checked ? "1" : "0";
                        cmd.ST_Customer_Division_K3 = ST_Customer_Division_K3.Checked ? "1" : "0";
                        cmd.ST_Customer_Division_K6 = ST_Customer_Division_K6.Checked ? "1" : "0";
                        cmd.ST_Customer_Division_10 = ST_Customer_Division_10.Checked ? "1" : "0";
                        cmd.ST_Customer_Division_K7 = ST_Customer_Division_K7.Checked ? "1" : "0";
                        cmd.ST_Customer_Division_K4 = ST_Customer_Division_K4.Checked ? "1" : "0";
                        cmd.ST_Customer_Division_K5 = ST_Customer_Division_K5.Checked ? "1" : "0";
                        cmd.ST_Switch_Off_Rounding = ST_Switch_Off_Rounding.Checked ? "1" : "0";
                        cmd.ST_Relevant_For_POD = ST_Relevant_For_POD.Checked ? "1" : "0";
                        cmd.ST_Rebate = ST_Rebate.Checked ? "1" : "0";
                        cmd.ST_Price_Determin = ST_Price_Determin.Checked ? "1" : "0";
                        cmd.ST_Order_Combination = ST_Order_Combination.Checked ? "1" : "0";
                        cmd.ST_Complete_Delivery_Reqd_By_Law = ST_Complete_Delivery_Reqd_By_Law.Checked ? "1" : "0";



                        // }
                        #endregion


                        (t_Attachment.process == TaskAPI.Process & t_Attachment.incident == 0 & t_Attachment.username == UserAPI.UserName).Edit<t_Attachment>(p =>
                        {
                            p.Incident = TaskAPI.Incident;
                        });

                        Storage.Save(Storage.Context1, cmd);
                    }
                    #endregion

                    #region Priority功能
                    if (TaskAPI.IsBeginStep && !string.IsNullOrEmpty(DrpPriority.SelectedValue))
                    {
                        mdc_Priority pro;
                        if ((mdc_Priority.process == TaskAPI.Process & mdc_Priority.incident == TaskAPI.Incident).Count<mdc_Priority>() > 0)
                        {
                            pro = new mdc_Priority();
                            pro = (mdc_Priority.process == TaskAPI.Process & mdc_Priority.incident == TaskAPI.Incident).ListFirst<mdc_Priority>();
                            pro.Business_Priority = Convert.ToInt32(DrpPriority.SelectedValue);
                            Storage.Save(pro);
                        }
                        else
                        {
                            pro = new mdc_Priority();
                            pro.Process = TaskAPI.Process;
                            pro.Incident = TaskAPI.Incident;
                            pro.Business_Priority = Convert.ToInt32(DrpPriority.SelectedValue);
                            Storage.Save(pro);
                        }

                    }


                    if ((TaskAPI.Step == "DMO Maintain" || TaskAPI.Step == "DMO Approve" || TaskAPI.Step == "DMO Check") && !string.IsNullOrEmpty(this.DMO_DrpPriority.SelectedValue) && !string.IsNullOrEmpty(DrpPriority.SelectedValue))
                    {

                        //mdc_Priority pro;
                        //pro = (mdc_Priority.process == TaskAPI.Process & mdc_Priority.incident == TaskAPI.Incident).ListFirst<mdc_Priority>();
                        //pro.DMO_Priority = Convert.ToInt32(DMO_DrpPriority.SelectedValue);
                        //Storage.Save(pro);
                        mdc_Priority pro;
                        if ((mdc_Priority.process == TaskAPI.Process & mdc_Priority.incident == TaskAPI.Incident).Count<mdc_Priority>() > 0)
                        {
                            pro = (mdc_Priority.process == TaskAPI.Process & mdc_Priority.incident == TaskAPI.Incident).ListFirst<mdc_Priority>();
                            pro.DMO_Priority = Convert.ToInt32(DMO_DrpPriority.SelectedValue);
                            Storage.Save(pro);
                        }
                        else
                        {
                            pro = (mdc_Priority.process == TaskAPI.Process & mdc_Priority.incident == TaskAPI.Incident).ListFirst<mdc_Priority>();
                            pro.DMO_Priority = Convert.ToInt32(DMO_DrpPriority.SelectedValue);
                            Storage.Save(pro);
                        }


                    }
                    #endregion

                    #region “DMO Maintain”步骤
                    if (TaskAPI.Step == "DMO Maintain")
                    {
                        (TW_cmd_Customer_Ship.process == TaskAPI.Process & TW_cmd_Customer_Ship.incident == TaskAPI.Incident).Edit<TW_cmd_Customer_Ship>(p =>
                        {
                            p.SAP_Code = SAP_Code.Text;
                        }
                        );
                    }
                    if (TaskAPI.Step == "DMO Maintain" || TaskAPI.Step == "DMO Approve" || TaskAPI.Step == "DMO Check")
                    {

                        TaskAPI["DMO_DrpPriority"] = DMO_DrpPriority.SelectedItem.Text;
                        (TW_cmd_Customer_Ship.process == TaskAPI.Process & TW_cmd_Customer_Ship.incident == TaskAPI.Incident).Edit<TW_cmd_Customer_Ship>(p =>
                        {
                            // p.SAP_Code = SAP_Code.Text;
                            p.DMO_DrpPriority = DMO_DrpPriority.SelectedValue;

                        }
                        );
                    }
                    #endregion

                    Storage.Save(Assessment1.Assessment);    //审批意见

                    //多节点退回
                    if (!string.IsNullOrEmpty(Assessment1.JumpStep))
                    {
                        Assessment1.SetAsReturn(true);
                        TaskAPI.DirectActive(Assessment1.JumpStep);
                    }
                    else
                    {
                        Assessment1.SetAsReturn(false);
                    }
                    Assessment1.SubmitTo();
                    flg = TaskAPI.Send();
                });

                //如果数据库写入成功且流程发起成功的情况，将业务表数据与流程实例号进行关联
                if (TaskAPI.IsInitiate)
                {
                    if (!string.IsNullOrEmpty(DrpPriority.SelectedValue))
                    {
                        (mdc_Priority.process == TaskAPI.Process & mdc_Priority.incident == 0).Edit<mdc_Priority>(p =>
                        {
                            p.Incident = TaskAPI.Incident;
                        });
                    }
                    (TW_cmd_Customer_Ship.process == TaskAPI.Process & TW_cmd_Customer_Ship.incident == 0 & TW_cmd_Customer_Ship.userName == UserAPI.UserName).Edit<TW_cmd_Customer_Ship>(p =>
                    {
                        p.Incident = TaskAPI.Incident;
                    });

                    (t_Assessment.process == TaskAPI.Process & t_Assessment.incident == 0 & t_Assessment.assignedToUserName == UserAPI.UserName).Edit<t_Assessment>(p =>
                    {
                        p.Incident = TaskAPI.Incident;
                    });


                    (t_Attachment.process == TaskAPI.Process & t_Attachment.incident == 0 & t_Attachment.username == UserAPI.UserName).Edit<t_Attachment>(p =>
                    {
                        p.Incident = TaskAPI.Incident;
                    });
                }
                #endregion

                Send.Visible = false;
                Anthem.Manager.AddScriptForClientSideEval("JSInfomation('" + Resources.Global.C_00_Success + "',true)");
            }
            catch (Exception ex)
            {
                TaskDB.Log("", false, "调用NVA方法Send_Click出错：" + ex.ToString());
                Anthem.Manager.AddScriptForClientSideEval("JSInfomation('" + Resources.Global.C_00_Failed + "',false)");
            }
        }
        #endregion



        #region 事件 Actions变换
        protected void Actions_SelectedIndexChanged(object sender, EventArgs e)
        {
            SetColor();
            SetEnable((Actions.SelectedValue == "1" || Actions.SelectedValue == "2" || Actions.SelectedValue == "3" || Actions.SelectedValue == "4"));

        }
        #endregion



        #region 方法 SetColor
        protected void SetColor()
        {
            SetForeColor(Color.Black, ST_Acct_Assgmt_Group_L, ST_Sold_To_No_L, ST_Language_L, ST_Sold_To_Name_L, ST_Ship_To_Name_L, ST_City_L, ST_Address_L, ST_Contact_Person_L,   ST_Delivery_Priority_L, ST_Shipping_Condition_L);

            switch (Actions.SelectedValue)
            {
                case "1":
                    SetForeColor(Color.Blue, ST_Sold_To_No_L, ST_Acct_Assgmt_Group_L,ST_Language_L,  ST_Sold_To_Name_L, ST_Ship_To_Name_L,  ST_City_L, ST_Address_L, ST_Contact_Person_L,  ST_Delivery_Priority_L, ST_Shipping_Condition_L);
                    break;

                case "2":
                    SetForeColor(Color.Blue, ST_Sold_To_No_L, ST_Ship_To_No_L, ST_Sold_To_Name_L);
                    break;

                case "3":
                    SetForeColor(Color.Blue, ST_Sold_To_No_L, ST_Ship_To_No_L, ST_Sold_To_Name_L);
                    break;

                case "4":
                    SetForeColor(Color.Blue, ST_Sold_To_No_L, ST_Ship_To_No_L, ST_Sold_To_Name_L);
                    break;
            }
        }
        #endregion

        #region 方法 SetDefaultValue(设置默认值, 并禁用输入)
        public void SetDefaultValue()
        {


            ST_Country.Text = "TW";
            ST_Transportation_Zone.Text = "TWOTH00000";
            ST_Sales_Org.Text = "TW01";
            ST_Currency.Text = "TWD";
            ST_Distribution.Text = "10(3rd party)";
            if (UserAPI.Department == "Supply Chain")
            {
                ST_Delivering_Plant.Text = "KT2D PKG";
            }
            else
            {
                ST_Delivering_Plant.Text = "KT1D DECO";
            }
            ST_Tax_Classification.Text = "1";
            ST_Cust_Pric.Text = "1 Standard";
            ST_Cus_Grp3.Text = "";
            ST_Partial_Delivery_Per_Item.Text = "";
            ST_Max_Partial_Deliveries.Text = "9";
            ST_Depart_Country.Text = "TW";
            ST_Switch_Off_Rounding.Checked = true;
            ST_Relevant_For_POD.Checked = true;
            ST_Rebate.Checked = true;
            ST_Price_Determin.Checked = true;
            ST_Order_Combination.Checked = false;
            ST_Complete_Delivery_Reqd_By_Law.Checked = false;

            SetEnable(false, ST_Switch_Off_Rounding,ST_Cust_Pric, ST_Relevant_For_POD, ST_Rebate, ST_Price_Determin, ST_Order_Combination, ST_Distribution, ST_Complete_Delivery_Reqd_By_Law, ST_Complete_Delivery_Reqd_By_Law, ST_Country, ST_Sales_Org, ST_Delivering_Plant, ST_Tax_Classification, ST_Cus_Grp3, ST_Partial_Delivery_Per_Item, ST_Max_Partial_Deliveries, ST_Depart_Country);
            SetForeColor(Color.Orange, ST_Distribution_L, ST_Cust_Pric_L,ST_Switch_Off_Rounding_L, ST_Relevant_For_POD_L, ST_Rebate_L, ST_Price_Determin_L, ST_Complete_Delivery_Reqd_By_Law_L, ST_Order_Combination_L, ST_Country_L, ST_Transportation_Zone_L, ST_Sales_Org_L, ST_Currency_L, ST_Delivering_Plant_L, ST_Tax_Classification_L, ST_Cus_Grp3_L, ST_Partial_Delivery_Per_Item_L, ST_Max_Partial_Deliveries_L, ST_Depart_Country_L);
        }
        #endregion

        #region 方法 InitDropdownList
        private void InitDropDownList()
        {
            if (!IsLoaded)
            {


                ST_Region.Items.Clear();
                ST_Region.Items.Add(new ListItem("", ""));
                IList<m_TW_Region> h1 = (m_TW_Region.status == 1).List<m_TW_Region>();
                foreach (m_TW_Region HY in h1)
                {

                    ST_Region.Items.Add(new ListItem(HY.TW_Region, HY.TW_Region));
                }




                ST_City_Code.Items.Clear();
                ST_City_Code.Items.Add(new ListItem("", ""));
                IList<m_TW_City_Code> h3 = (m_TW_City_Code.status == 1).List<m_TW_City_Code>();
                foreach (m_TW_City_Code HY in h3)
                {

                    ST_City_Code.Items.Add(new ListItem(HY.City_Code, HY.City_Code));
                }



                ST_Industry.Items.Clear();
                ST_Industry.Items.Add(new ListItem("", ""));
                IList<m_TW_Industry_Global> h4 = (m_TW_Industry_Global.status == 1).List<m_TW_Industry_Global>();
                foreach (m_TW_Industry_Global HY in h4)
                {

                    ST_Industry.Items.Add(new ListItem(HY.TW_Industry_Global, HY.TW_Industry_Global));
                }


                ST_Industry_Code1.Items.Clear();
                ST_Industry_Code1.Items.Add(new ListItem("", ""));
                IList<m_TW_Industry_Code1_Local> h5 = (m_TW_Industry_Code1_Local.status == 1).List<m_TW_Industry_Code1_Local>();
                foreach (m_TW_Industry_Code1_Local HY in h5)
                {

                    ST_Industry_Code1.Items.Add(new ListItem(HY.Industry_Code1_Local, HY.Industry_Code1_Local));
                }


                //BA_Industry_Code3.Items.Clear();
                //RE_BA_Industry_Code3.Items.Clear();
                //BA_Industry_Code3.Items.Add(new ListItem("", ""));
                //RE_BA_Industry_Code3.Items.Add(new ListItem("", ""));
                //IList<m_TW_Industry_Code_3_Corp> h6 = (m_TW_Industry_Code_3_Corp.status == 1).List<m_TW_Industry_Code_3_Corp>();
                //foreach (m_TW_Industry_Code_3_Corp HY in h6)
                //{
                //    BA_Industry_Code3.Items.Add(new ListItem(HY.Industry_Code_3_Corp, HY.Industry_Code_3_Corp));
                //    RE_BA_Industry_Code3.Items.Add(new ListItem(HY.Industry_Code_3_Corp, HY.Industry_Code_3_Corp));
                //}

                ST_Sales_District.Items.Clear();
                ST_Sales_District.Items.Add(new ListItem("", ""));
                IList<m_TW_Sales_District> h6 = (m_TW_Sales_District.status == 1).List<m_TW_Sales_District>();
                foreach (m_TW_Sales_District HY in h6)
                {

                    ST_Sales_District.Items.Add(new ListItem(HY.Sales_District, HY.Sales_District));
                }




                ST_Sales_Office.Items.Clear();
                ST_Sales_Office.Items.Add(new ListItem("", ""));
                IList<m_TW_Sales_Office> h10 = (m_TW_Sales_Office.status == 1).List<m_TW_Sales_Office>();
                foreach (m_TW_Sales_Office HY in h10)
                {

                    ST_Sales_Office.Items.Add(new ListItem(HY.Sales_Office, HY.Sales_Office));
                }



                ST_Price_Group_1.Items.Clear();
                ST_Price_Group_2.Items.Clear();
                ST_Price_Group_1.Items.Add(new ListItem("", ""));
                ST_Price_Group_2.Items.Add(new ListItem("", ""));
                IList<m_TW_Price_Group> h11 = (m_TW_Price_Group.status == 1).List<m_TW_Price_Group>();
                foreach (m_TW_Price_Group HY in h11)
                {

                    ST_Price_Group_1.Items.Add(new ListItem(HY.Price_Group, HY.Price_Group));
                    ST_Price_Group_2.Items.Add(new ListItem(HY.Price_Group, HY.Price_Group));
                }



                //ST_Cust_Pric.Items.Clear();
                //ST_Cust_Pric.Items.Add(new ListItem("", ""));
                //IList<m_TW_Cust_Pric_Proc> h12 = (m_TW_Cust_Pric_Proc.status == 1).List<m_TW_Cust_Pric_Proc>();
                //foreach (m_TW_Cust_Pric_Proc HY in h12)
                //{

                //    ST_Cust_Pric.Items.Add(new ListItem(HY.Cust_Pric_Proc, HY.Cust_Pric_Proc));
                //}



                ST_Delivery_Priority.Items.Clear();
                ST_Delivery_Priority.Items.Add(new ListItem("", ""));
                IList<m_TW_Delivery_Priority> h13 = (m_TW_Delivery_Priority.status == 1).List<m_TW_Delivery_Priority>();
                foreach (m_TW_Delivery_Priority HY in h13)
                {

                    ST_Delivery_Priority.Items.Add(new ListItem(HY.Delivery_Priority, HY.Delivery_Priority));
                }



                ST_Shipping_Condition.Items.Clear();

                ST_Shipping_Condition.Items.Add(new ListItem("", ""));
                IList<m_TW_Shipping_Conditions> h14 = (m_TW_Shipping_Conditions.status == 1).List<m_TW_Shipping_Conditions>();
                foreach (m_TW_Shipping_Conditions HY in h14)
                {

                    ST_Shipping_Condition.Items.Add(new ListItem(HY.Shipping_Conditions, HY.Shipping_Conditions));
                }


                ST_Itcoterms.Items.Clear();

                ST_Itcoterms.Items.Add(new ListItem("", ""));

                IList<m_TW_Incoterms> h15 = (m_TW_Incoterms.status == 1).List<m_TW_Incoterms>();
                foreach (m_TW_Incoterms HY in h15)
                {
                    ST_Itcoterms.Items.Add(new ListItem(HY.Incoterms, HY.Incoterms));

                }


                ST_Acct_Assgmt_Group.Items.Clear();
                ST_Acct_Assgmt_Group.Items.Add(new ListItem("", ""));
                IList<m_TW_Acct_Assgmt_Group> h16 = (m_TW_Acct_Assgmt_Group.status == 1).List<m_TW_Acct_Assgmt_Group>();
                foreach (m_TW_Acct_Assgmt_Group HY in h16)
                {
                    ST_Acct_Assgmt_Group.Items.Add(new ListItem(HY.Acct_Assgmt_Group, HY.Acct_Assgmt_Group));

                }


                ST_Attributes1.Items.Clear();
                ST_Attributes1.Items.Add(new ListItem("", ""));
                IList<m_TW_Attributes1> h17 = (m_TW_Attributes1.status == 1).List<m_TW_Attributes1>();
                foreach (m_TW_Attributes1 HY in h17)
                {
                    ST_Attributes1.Items.Add(new ListItem(HY.TW_Attributes1, HY.TW_Attributes1));

                }

                ST_Attributes2.Items.Clear();
                ST_Attributes2.Items.Add(new ListItem("", ""));
                IList<m_TW_Attributes2> h18 = (m_TW_Attributes2.status == 1).List<m_TW_Attributes2>();
                foreach (m_TW_Attributes2 HY in h18)
                {
                    ST_Attributes2.Items.Add(new ListItem(HY.TW_Attributes2, HY.TW_Attributes2));

                }

                ST_Attributes3.Items.Clear();
                ST_Attributes3.Items.Add(new ListItem("", ""));
                IList<m_TW_Attributes3> h19 = (m_TW_Attributes3.status == 1).List<m_TW_Attributes3>();
                foreach (m_TW_Attributes3 HY in h19)
                {
                    ST_Attributes3.Items.Add(new ListItem(HY.TW_Attributes3, HY.TW_Attributes3));

                }

                ST_Attributes4.Items.Clear();
                ST_Attributes4.Items.Add(new ListItem("", ""));
                IList<m_TW_Attributes4> h20 = (m_TW_Attributes4.status == 1).List<m_TW_Attributes4>();
                foreach (m_TW_Attributes4 HY in h20)
                {
                    ST_Attributes4.Items.Add(new ListItem(HY.TW_Attributes4, HY.TW_Attributes4));

                }




                IsLoaded = true;
            }
        }
        #endregion

        #region 方法 数据验证
        private List<string> DataValidation()
        {
            List<string> vald_s = new List<string>();
            List<string> vald_s_2 = new List<string>();
            List<string> vald_s_3 = new List<string>();
            List<string> vald_s_4 = new List<string>();
            List<string> vald_s_5 = new List<string>();
            List<Regular> regs = new List<Regular>();





            #region SA
            regs.Clear();
            if (Actions.SelectedValue == "1")
            {
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Sold_To_No.Text, "Sold to No.客户编号   必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Sold_To_Name.Text, "Sold to Name(公司名称)  必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Ship_To_Name.Text, "Ship to Name 1(送貨地阯名稱)  必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Language.SelectedValue, "Language  必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, ST_City.Text, "City(鄉鎮市)  必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Address.Text, "House No./street(詳細地址)  必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Contact_Person.Text, "C/O(聯繫人)  必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, ST_City_Code.SelectedValue, "City code(城市代碼)  必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, ST_Sales_District.SelectedValue, "Sales District  必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, ST_Sales_Office.SelectedValue, "Sales Office(銷售區域)  必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, ST_Cust_Pric.SelectedValue, "Cust.pric.proc.(客戶定價過程)  必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Acct_Assgmt_Group.SelectedValue, "Acct assgmt group:.(客戶定價過程)  必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, ST_Itcoterms.SelectedValue, "Itcoterms  必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Delivery_Priority.SelectedValue, "Delivery Priority(交貨優先級)  必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Shipping_Condition.SelectedValue, "Shipping Conditions(運輸條件)  必填"));
                if (ST_Delivering_Plant.Text == "KT1D DECO" && !ST_Customer_Division_K1.Checked && !ST_Customer_Division_K2.Checked && !ST_Customer_Division_K3.Checked && !ST_Customer_Division_K6.Checked && !ST_Customer_Division_10.Checked && !ST_Customer_Division_K7.Checked)
                {
                    regs.Add(new Regular(RegularExp.NotEmpty, "", "1.Retail-K1 或 2.Project-K2 或 3.Modern Trade-K3 或 4.MRT-K6 或 5.KA Project-K7 或 6.Gen-Exp-10 至少需要填写 1 个"));
                }
                if (ST_Delivering_Plant.Text == "KT2D PKG" && !ST_Customer_Division_K4.Checked && !ST_Customer_Division_K4.Checked)
                {
                    regs.Add(new Regular(RegularExp.NotEmpty, "", "1.Domestic-K4 或 2.Export-K5 至少需要填写 1 个"));
                }
                //if (ST_Customer_Division_K1.Checked && Actions.SelectedValue == "1")
                //{
                //    regs.Add(new Regular(RegularExp.NotEmpty, ST_Price_Group_1.SelectedValue, " Price Group(K1) 必填"));
                //}
                //if (ST_Customer_Division_K2.Checked && Actions.SelectedValue == "1")
                //{
                //    regs.Add(new Regular(RegularExp.NotEmpty, ST_Price_Group_2.SelectedValue, " Price Group(K2) 必填"));
                //}

            }

            if (Actions.SelectedValue != "1")
            {
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Sold_To_No.Text, "Sold to No.客户编号   必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Sold_To_Name.Text, "Sold to Name(公司名称)   必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Ship_To_No.Text, "Existed ship to Code  必填"));
                //if (!ST_Customer_Division_K1.Checked && !ST_Customer_Division_K2.Checked && !ST_Customer_Division_K3.Checked)
                //{
                //    regs.Add(new Regular(RegularExp.NotEmpty, "", "1.Retail-K1 或 2.Project-K2 或 3.Modern Trade-K3至少需要填写 1 个"));
                //}
            }

            vald_s_2 = Validation(regs);
            if (vald_s_2.Count > 0)
            {
                vald_s_2.Insert(0, "<font color='#0000FF'><b>Ship to</b></font>");
                vald_s.AddRange(vald_s_2);
            }

            #endregion


            return vald_s;
            //return Validation(regs);
        }
        #endregion

        #region 方法 Others
        private string getFormCheckList(Anthem.CheckBoxList ck)
        {
            string t = "";
            for (int i = 0; i < ck.Items.Count; i++)
                if (ck.Items[i].Selected)
                    t += "," + ck.Items[i].Value;
                else
                    t += ",";
            return t;
        }
        private Anthem.CheckBoxList setCheckList(string t, Anthem.CheckBoxList ck)
        {
            try
            {
                string[] tt = t.Split(',');

                for (int i = 0; i <= tt.GetUpperBound(0); i++)
                {
                    for (int j = 0; j < ck.Items.Count; j++)
                    {
                        if (ck.Items[j].Value == tt[i].ToString())
                        { ck.Items[j].Selected = true; break; }
                    }
                }
            }
            catch { }
            return ck;
        }
        #endregion

        #region 方法 SetDropDownListValue
        private void SetDropDownListValue(Anthem.DropDownList drpT, object o)
        {
            try
            {
                if ((TaskAPI.IsBeginStep && TaskAPI.IsAllowSubmit) || drpT.Items.FindByValue(o.ToString()) != null)
                {
                    drpT.SelectedValue = o.ToString();
                    return;
                }

                drpT.Items.Add(new ListItem(o.ToString(), o.ToString()));
                drpT.SelectedIndex = 0;

            }
            catch (Exception)
            {
            }
        }
        #endregion

        #region 重载 OnLoadComplete
        protected override void OnLoadComplete(EventArgs e)
        {
            if (!IsLoaded && TaskAPI.IsBeginStep && TaskAPI.IsAllowSubmit)
            {
                Actions_SelectedIndexChanged(null, e);
            }

            base.OnLoadComplete(e);
        }
        #endregion

        #region 表单中 Seach Term 1= Name1 ,Seach Term 2= BPCS Code



        protected void ST_Ship_To_Name_TextChanged(object sender, EventArgs e)
        {
            ST_Search_Term1.Text = ST_Ship_To_Name.Text;
        }



        protected void ST_Old_Ship_BPCS_TextChanged(object sender, EventArgs e)
        {
            ST_Search_Term2.Text = ST_Old_Ship_BPCS.Text;
        }



        #endregion

        #region City Code带出County Code



        protected void ST_City_Code_SelectedIndexChanged(object sender, EventArgs e)
        {
            ST_County_Code.Text = "";
            IList<m_TW_City_Code> bh3 = (m_TW_City_Code.status == 1 & (m_TW_City_Code.city_Code == ST_City_Code.SelectedValue
             | m_TW_City_Code.city_Code == "")).List<m_TW_City_Code>();
            foreach (m_TW_City_Code BH in bh3)
            {

                ST_County_Code.Text = BH.County_Code;

            }
        }

        #endregion



        #region Region

        protected void ST_Region_SelectedIndexChanged(object sender, EventArgs e)
        {
            ST_Attributes9.Text = ST_Region.Text;
        }
        #endregion




        //protected void ST_Customer_Division_K1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (ST_Customer_Division_K1.Checked)
        //    {
        //        SetForeColor(Color.Blue, ST_Price_Group_1_L);
        //    }
        //    else
        //    {
        //        SetForeColor(Color.Black, ST_Price_Group_1_L);
        //    }
        //}

        //protected void ST_Customer_Division_K2_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (ST_Customer_Division_K2.Checked)
        //    {
        //        SetForeColor(Color.Blue, ST_Price_Group_2_L);
        //    }
        //    else
        //    {
        //        SetForeColor(Color.Black, ST_Price_Group_2_L);
        //    }
        //}

    }
}